long fact_while(long n){
    long res = 1;
    while ( n>1 ){
        res *= n;
        n = n-1;
    }
    return res;
}